<template>
    <div>
        <!-- 表格组件 -->
        <div class="table">
      <el-table :data="tableData" style="width: 100%" border>
        <el-table-column prop="id" label="ID" width="80"> </el-table-column>
        <el-table-column prop="name" label="商品名称" width="180">
        </el-table-column>
        <el-table-column prop="retail_price" label="售价"> </el-table-column>
        <el-table-column prop="goods_number" label="库存"> </el-table-column>

        <el-table-column prop="" label="新品">
          <template slot-scope="scope">
            <span style="margin-left: 10px">{{
              scope.row.is_new === 0 ? "否" : "是"
            }}</span>
          </template>
        </el-table-column>

        <el-table-column prop="" label="人气">
          <template slot-scope="scope">
            <span style="margin-left: 10px">{{
              scope.row.is_hot === 0 ? "是" : "否"
            }}</span>
          </template>
        </el-table-column>
        <el-table-column prop="" label="上架">
          <template slot-scope="scope">
            <span style="margin-left: 10px">{{
              scope.row.is_delete === 0 ? "是" : "否"
            }}</span>
          </template>
        </el-table-column>
        <el-table-column prop="sort_order" label="排序"> </el-table-column>
        <el-table-column label="操作">
          <template slot-scope="scope">
            <el-button type="primary" @click="editFn(scope.row.id)"
              >编辑</el-button
            >
          </template>

          ></el-table-column
        >
      </el-table>
    </div>
    </div>
</template>

<script>
export default {
    data () {
        return {
            // tableData
        }
    },
    props:['tableData'],
    methods:{
          //点击编辑按钮
    editFn(id) {
      // console.log(id);
      this.$router.push(`/editgood/${id}`);
    },
    }
}
</script>
 
<style lang = "less" scoped>
    
</style>